package batch;

import java.sql.Connection;
import java.sql.DriverManager;
  
public class Mysqlconn {  
    public Connection Connect(String dbName,String tableName,String user,String password) 
    		throws ClassNotFoundException {  
    	Connection connection = null;
    	try {  
            Class.forName("com.mysql.jdbc.Driver");  
            connection = DriverManager.getConnection(  
                    "jdbc:mysql://localhost:3306/"+dbName, user, password);  
        } 
    	catch (Exception e) {  
            e.printStackTrace();
        }  
    	return connection;
    } 
    
}